﻿function convertounsign(str) {
    str = str.toLowerCase();
    str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a");
    str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e");
    str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i");
    str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, "o");
    str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, "u");
    str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g, "y");
    str = str.replace(/đ/g, "d");
    str = str.replace(/!|@|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\;|\'| |\"|\&|\#|\[|\]|~|$|_/g, "-");
    /* tìm và thay thế các kí tự đặc biệt trong chuỗi sang kí tự - */
    str = str.replace(/-+-/g, "-"); //thay thế 2- thành 1- 
    str = str.replace(/^\-+|\-+$/g, "");
    //cắt bỏ ký tự - ở đầu và cuối chuỗi  
    return str;
}
function number_format(number, decimals, dec_point, thousands_sep) {

    var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
    var d = dec_point == undefined ? "," : dec_point;
    var t = thousands_sep == undefined ? "." : thousands_sep, s = n < 0 ? "-" : "";
    var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
    return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
}
function ajaxcateid(id)
{
    $.mobile.showPageLoadingMsg();
    var AppUrl = $("#AppUrl").text();
    var lang = $("#CurrentLangCode").html();
    var urlvnbanknet = "http://vnbanknet.com/Content/UpLoad/Images";
    $("#rel_cate").html(id);
    if (lang == "vi-VN") {
        if ($("#years-saving").val() < 1) {
            var val_month = $("#month-saving").val();
        }
        else {
            var val_month = $("#years-saving").val() * 12;
        }
        var a = $("#amount-saving").val().replace(".", "").replace(".", "").replace(".", "");
        var ba = parseFloat(a);
        var interes = 0;
        var val_cate = $("#rel_cate").html();
        $.ajax({
            type: "post",
            url: AppUrl + "/DepositSaving/getDepositSaving",
            data: { cateid: val_cate, balance: ba, month: val_month },
            dataType: "json",
            success: function (rvdata) {
                var htmlcode = "";
                if (rvdata.length > 0) {
                    $(rvdata).each(function (index, item) {
                        if (val_cate == 1) {
                            interes = Math.pow(1 + ((item.InterestVND) / 100 / 12), val_month);
                            var ina = Math.round(parseFloat(interes * ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND.toString().replace(".", ",") + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Liên hệ</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";

                        }
                        else {
                            interes = ba * val_month * ((item.InterestVND) / 100 / 12);
                            var ina = Math.round(parseFloat(interes + ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND.toString().replace(".", ",") + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Liên hệ</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";
                        }
                    });
                }

                else {

                }
                $("#pro-list").html(htmlcode);
            }

        });
    }
    else {
        if ($("#years-saving").val() < 1) {
            var val_month = $("#month-saving").val();
        }
        else {
            var val_month = $("#years-saving").val() * 12;
        }
        var a = $("#amount-saving").val().replace(".", "").replace(".", "").replace(".", "");
        var ba = parseFloat(a);
        var interes = 0;
        var val_cate = $("#rel_cate").html();
        $.ajax({
            type: "post",
            url: AppUrl + "/DepositSaving/getDepositSaving",
            data: { cateid: val_cate, balance: ba, month: val_month },
            dataType: "json",
            success: function (rvdata) {
                var htmlcode = "";
                if (rvdata.length > 0) {
                    $(rvdata).each(function (index, item) {
                        if (val_cate == 1) {
                            interes = Math.pow(1 + ((item.InterestVND) / 100 / 12), val_month);
                            var ina = Math.round(parseFloat(interes * ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Contact</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";

                        }
                        else {
                            interes = ba * val_month * ((item.InterestVND) / 100 / 12);
                            var ina = Math.round(parseFloat(interes + ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Contact</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";
                        }
                    });
                }

                else {

                }
                $("#pro-list").html(htmlcode);
            }
        });
    }
    $.mobile.hidePageLoadingMsg();
}
function ajaxcateidbyprovider(id) {
    $.mobile.showPageLoadingMsg();
    var comid = $("#comid").html();
    var AppUrl = $("#AppUrl").text();
    var lang = $("#CurrentLangCode").html();
    var urlvnbanknet = "http://vnbanknet.com/Content/UpLoad/Images";
    $("#rel_cate").html(id);
    if (lang == "vi-VN") {
        if ($("#years-saving").val() < 1) {
            var val_month = $("#month-saving").val();
        }
        else {
            var val_month = $("#years-saving").val() * 12;
        }
        var a = $("#amount-saving").val().replace(".", "").replace(".", "").replace(".", "");
        var ba = parseFloat(a);
        var interes = 0;
        var val_cate = $("#rel_cate").html();
        $.ajax({
            type: "post",
            url: AppUrl + "/DepositSaving/getDepositSavingListByProvider",
            data: { cateid: val_cate, balance: ba, month: val_month, CompanyID: comid },
            dataType: "json",
            success: function (rvdata) {
                var htmlcode = "";
                if (rvdata.length > 0) {
                    $(rvdata).each(function (index, item) {
                        if (val_cate == 1) {
                            interes = Math.pow(1 + ((item.InterestVND) / 100 / 12), val_month);
                            var ina = Math.round(parseFloat(interes * ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND.toString().replace(".", ",") + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Liên hệ</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";

                        }
                        else {
                            interes = ba * val_month * ((item.InterestVND) / 100 / 12);
                            var ina = Math.round(parseFloat(interes + ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND.toString().replace(".", ",") + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Liên hệ</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";
                        }
                    });
                }

                else {

                }
                $("#pro-list").html(htmlcode);
            }

        });
    }
    else {
        if ($("#years-saving").val() < 1) {
            var val_month = $("#month-saving").val();
        }
        else {
            var val_month = $("#years-saving").val() * 12;
        }
        var a = $("#amount-saving").val().replace(".", "").replace(".", "").replace(".", "");
        var ba = parseFloat(a);
        var interes = 0;
        var val_cate = $("#rel_cate").html();
        $.ajax({
            type: "post",
            url: AppUrl + "/DepositSaving/getDepositSavingListByProvider",
            data: { cateid: val_cate, balance: ba, month: val_month },
            dataType: "json",
            success: function (rvdata) {
                var htmlcode = "";
                if (rvdata.length > 0) {
                    $(rvdata).each(function (index, item) {
                        if (val_cate == 1) {
                            interes = Math.pow(1 + ((item.InterestVND) / 100 / 12), val_month);
                            var ina = Math.round(parseFloat(interes * ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Contact</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";

                        }
                        else {
                            interes = ba * val_month * ((item.InterestVND) / 100 / 12);
                            var ina = Math.round(parseFloat(interes + ba));
                            htmlcode += "     <tr class='views-row-first'>";
                            htmlcode += "   <td class='views-field views-field-name muted'>";
                            htmlcode += "     <strong><a title='" + item.DepositSavingName + "' class='name-product-list ui-link' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.DepositSavingName).toLowerCase() + "/" + item.DepositSavingID + "'>" + item.DepositSavingName + "</a>";
                            htmlcode += "      <br />";
                            htmlcode += "     <a  title='" + item.CompanyName + "' href='" + AppUrl + "/term-saving/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "'>";
                            htmlcode += "       <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "' /></a>";
                            htmlcode += "       </strong></td>";
                            if (item.InterestVND != 0) {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>" + item.InterestVND + " %</span><br>";
                                htmlcode += "    </td>";
                                htmlcode += "    <td class='cl-mid value'>";
                                htmlcode += "       <div class='highlight-blue total-interest'>" + number_format(ina, 0, ",", ".") + "</div>";
                                htmlcode += "      <div class='interest-period muted'></div>";
                                htmlcode += "   </td>";
                            }
                            else {
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Contact</span><br>";
                                htmlcode += "   </td>";
                            }
                            htmlcode += "   <td class='cl-mid text-center'><a href='" + AppUrl + "/term-saving/apply/" + item.DepositSavingID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext ui-btn-up-c'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                            htmlcode += "  </tr>";
                        }
                    });
                }

                else {

                }
                $("#pro-list").html(htmlcode);
            }
        });
    }
    $.mobile.hidePageLoadingMsg();
}
$(document).ready(function () {
    var AppUrl = $("#AppUrl").text();
    var lang = $("#CurrentLangCode").html();
    var urlvnbanknet = "http://vnbanknet.com/Content/UpLoad/Images";
    $("#select-creditcard-pro").change(function () {
        var cardpro = $("#select-creditcard-pro").val();
        $.mobile.showPageLoadingMsg();
        if (cardpro != 0) {
            $.ajax({
                type: "post",
                url: AppUrl + "/CreditCard/getCreditCardListByProperties",
                data: { CreditCareProperties: cardpro, },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length != 0) {
                        if (lang == "vi-VN") {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='Xem danh sách thẻ của - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Phí năm</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Phí năm</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Lãi suất</strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Lãi suất</strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>Xem chi tiết</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Quyền lợi</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Tính năng</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }
                        else {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='View list cards by - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Cost</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Cost</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Interest: </strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Interest: </strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>View Detail</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Benefit</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Feature</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }

                    }
                    else {
                        if (lang == "vi-VN") {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>Không có dữ liệu phù hợp</p></td></tr>";
                        }
                        else {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>No result</p></td></tr>";
                        }
                    }
                    $("#credit-card-list").html(htmlcode);
                    $.mobile.hidePageLoadingMsg();
                }

            });
        }
        else {
            $.ajax({
                type: "post",
                url: AppUrl + "/CreditCard/getCreditCardListAll",
                data: { },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length != 0) {
                        if (lang == "vi-VN") {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='Xem danh sách thẻ của - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Phí năm</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Phí năm</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Lãi suất</strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Lãi suất</strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>Xem chi tiết</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Quyền lợi</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Tính năng</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }
                        else {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='View list cards by - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Cost</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Cost</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Interest: </strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Interest: </strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>View Detail</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Benefit</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Feature</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }

                    }
                    else {
                        if (lang == "vi-VN") {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>Không có dữ liệu phù hợp</p></td></tr>";
                        }
                        else {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>No result</p></td></tr>";
                        }
                    }
                    $("#credit-card-list").html(htmlcode);
                    $.mobile.hidePageLoadingMsg();
                }

            });
        }
    });
    $("#select-creditcard-pro-bycom").change(function () {
        var cardpro = $("#select-creditcard-pro-bycom").val();
        var com = $("#radio-wrapper").html();
        $.mobile.showPageLoadingMsg();
        if (cardpro != 0) {
            $.ajax({
                type: "post",
                url: AppUrl + "/CreditCard/getcardbycom_pro",
                data: { CreditCardProperties: cardpro, CompanyID: com },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length != 0) {
                        if (lang == "vi-VN") {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='Xem danh sách thẻ của - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Phí năm</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Phí năm</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Lãi suất</strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Lãi suất</strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>Xem chi tiết</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Quyền lợi</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Tính năng</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }
                        else {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='View list cards by - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Cost</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Cost</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Interest: </strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Interest: </strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>View Detail</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Benefit</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Feature</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }

                    }
                    else {
                        if (lang == "vi-VN") {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>Không có dữ liệu phù hợp</p></td></tr>";
                        }
                        else {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>No result</p></td></tr>";
                        }
                    }
                    $("#credit-card-list").html(htmlcode);
                    $.mobile.hidePageLoadingMsg();
                }

            });
        }
        else {
            $.ajax({
                type: "post",
                url: AppUrl + "/CreditCard/getCreditCardListAllByProvider",
                data: { CompanyID: com },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length != 0) {
                        if (lang == "vi-VN") {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='Xem danh sách thẻ của - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Phí năm</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Phí năm</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Lãi suất</strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Lãi suất</strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='Xem chi tiết' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>Xem chi tiết</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Quyền lợi</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Tính năng</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }
                        else {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "<div class='product-item'>";
                                htmlcode += "<p class='bank-title'>";
                                htmlcode += "<a title='View list cards by - " + item.CompanyName + "' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + item.CompanyID + "'>" + item.CompanyName + "</a>";
                                htmlcode += "" + item.CardName + "";
                                htmlcode += " </p>";

                                htmlcode += "  <a title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "'>";
                                htmlcode += "     <img alt='" + item.CardName + "' class='product-item-img' src='" + urlvnbanknet + "/" + item.CardImage + "'/>";
                                htmlcode += "   </a>";
                                htmlcode += "                 <ul class='ul-info'>";
                                if (item.Cost > 0) {
                                    htmlcode += "                <li><strong>Cost</strong> " + number_format(item.Cost, 0, ",", ".") + "</li>";
                                }
                                else {
                                    htmlcode += "                <li><strong>Cost</strong> 0</li>";
                                }
                                if (item.Interest > 0) {
                                    htmlcode += " <li><strong>Interest: </strong> " + item.Interest.toString().replace(".", ",") + " %</li>";
                                }
                                else {
                                    htmlcode += "  <li><strong>Interest: </strong> -</li>";
                                }
                                htmlcode += " <li>";
                                htmlcode += "    <a class='btn-detail ui-btn ui-shadow ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-b' title='View Detail' href='" + AppUrl + "/credit-card/" + convertounsign(item.CompanyName.toLowerCase()) + "/" + convertounsign(item.CardName).toLowerCase() + "/" + item.CardID + "' data-role='button' data-corners='false' data-mini='true' data-inline='true' data-icon='grid' data-theme='b' data-shadow='true' data-iconshadow='true' data-wrapperels='span'><span class='ui-btn-inner'><span class='ui-btn-text'>View Detail</span><span class='ui-icon ui-icon-grid ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "  </li>              ";
                                htmlcode += "            </ul>";
                                htmlcode += "           <div style='clear: both;'></div>";

                                htmlcode += "          <h4 class='title'>Benefit</h4>";
                                htmlcode += "          <div class='item-list'>";
                                htmlcode += "            " + item.BenefitContent + "";
                                htmlcode += "      </div>";

                                htmlcode += "      <h4 class='title'>Feature</h4>";
                                htmlcode += "       <div class='item-list'>";
                                htmlcode += "         " + item.FurtureContent + "";
                                htmlcode += "      </div>";
                                htmlcode += "      <a href='" + AppUrl + "/credit-card/apply/" + item.CardID + "' data-mini='true' data-corners='false' data-theme='b' data-icon='arrow-r' data-iconpos='right' data-role='button' data-shadow='true' data-iconshadow='true' data-wrapperels='span' class='ui-btn ui-shadow ui-mini ui-btn-icon-right ui-btn-up-b'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a>";
                                htmlcode += "   </div>";
                                htmlcode += "   <div style='clear: both;'></div>";
                                htmlcode += "   <hr style='background: #bebebe;' />";
                            });
                        }

                    }
                    else {
                        if (lang == "vi-VN") {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>Không có dữ liệu phù hợp</p></td></tr>";
                        }
                        else {
                            htmlcode += "<tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>No result</p></td></tr>";
                        }
                    }
                    $("#credit-card-list").html(htmlcode);
                    $.mobile.hidePageLoadingMsg();
                }

            });
        }
    });
    $("#select-customerloan").change(function () {
        $.mobile.showPageLoadingMsg();
        var val_cate = $("#select-customerloan").val();
        var val_month = $("#years-saving").val();
        if (lang == "vi-VN") {
            var amount = $("#amount-saving").val().replace(".", "").replace(".", "").replace(".", "");
            var ba = parseFloat(amount);
            $.ajax({
                type: "post",
                url: AppUrl + "/ConsumerLoan/getConsumerLoan",
                data: { planid: val_cate, balance: ba, years: val_month },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length > 0) {
                        if (val_cate == 1) {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src=''></a>";
                                htmlcode += "   </strong></td>";
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Liên hệ</span><br>";
                                htmlcode += "  </td>";
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                        else {
                            var payment = 0;
                            $(rvdata).each(function (index, item) {
                                var total = 0;
                                for (i = 1; i <= val_month * 12; i++) {
                                    total += Math.pow((1 + (item.InterestVND / 100 / 12)), -i);
                                }
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "'></a>";
                                htmlcode += "   </strong></td>";
                                if (item.InterestVND != 0) {
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + item.InterestVND.toString().replace(".", ",") + " %</p>";
                                    htmlcode += " </td>";
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + number_format(ba / total, 0, ",", ".") + "</p>";

                                    htmlcode += " </td>";
                                }
                                else {
                                    htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                    htmlcode += "     <span class='highlight-blue-1 interest-rate'>Liên hệ</span><br>";
                                    htmlcode += "  </td>";
                                }
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                    }
                    else {
                        htmlcode = "<tr><td colspan='4' style='text-align:center;'><tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>Không có dữ liệu phù hợp</p></td></tr></td></tr>";
                    }
                    $("#pro-list").html(htmlcode);
                }

            });
            $.mobile.hidePageLoadingMsg();
        }
        else {
            var amount = $("#amount-saving").val().replace(".", "").replace(".", "").replace(".", "");
            var ba = parseFloat(amount);
            $.ajax({
                type: "post",
                url: AppUrl + "/ConsumerLoan/getConsumerLoan",
                data: { planid: val_cate, balance: ba, years: val_month },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length > 0) {
                        if (val_cate == 1) {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src=''></a>";
                                htmlcode += "   </strong></td>";
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Contact</span><br>";
                                htmlcode += "  </td>";
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                        else {
                            var payment = 0;
                            $(rvdata).each(function (index, item) {
                                var total = 0;
                                for (i = 1; i <= val_month * 12; i++) {
                                    total += Math.pow((1 + (item.InterestVND / 100 / 12)), -i);
                                }
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "'></a>";
                                htmlcode += "   </strong></td>";
                                if (item.InterestVND != 0) {
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + item.InterestVND.toString().replace(",", ".") + " %</p>";
                                    htmlcode += " </td>";
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + number_format(ba / total, 0, ".", ",") + "</p>";

                                    htmlcode += " </td>";
                                }
                                else {
                                    htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                    htmlcode += "     <span class='highlight-blue-1 interest-rate'>Liên hệ</span><br>";
                                    htmlcode += "  </td>";
                                }
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                    }
                    else {
                        htmlcode = "<tr><td colspan='4' style='text-align:center;'><tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>No result</p></td></tr></td></tr>";
                    }
                    $("#pro-list").html(htmlcode);
                }

            });
            $.mobile.hidePageLoadingMsg();
        }
    });
    $("#select-customerloan-byprovider").change(function () {
        $.mobile.showPageLoadingMsg();
        var val_cate = $("#select-customerloan-byprovider").val();
        var val_month = $("#years-saving").val();
        var comid = $("#val-com").html();
        if (lang == "vi-VN") {
            var amount = $("#amount-saving").val().replace(".", "").replace(".", "").replace(".", "");
            var ba = parseFloat(amount);
            $.ajax({
                type: "post",
                url: AppUrl + "/ConsumerLoan/getConsumerLoanByProvider",
                data: { planid: val_cate, balance: ba, years: val_month, CompanyID: comid },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length > 0) {
                        if (val_cate == 1) {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src=''></a>";
                                htmlcode += "   </strong></td>";
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Liên hệ</span><br>";
                                htmlcode += "  </td>";
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                        else {
                            var payment = 0;
                            $(rvdata).each(function (index, item) {
                                var total = 0;
                                for (i = 1; i <= val_month * 12; i++) {
                                    total += Math.pow((1 + (item.InterestVND / 100 / 12)), -i);
                                }
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "'></a>";
                                htmlcode += "   </strong></td>";
                                if (item.InterestVND != 0) {
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + item.InterestVND.toString().replace(".", ",") + " %</p>";
                                    htmlcode += " </td>";
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + number_format(ba / total, 0, ",", ".") + "</p>";

                                    htmlcode += " </td>";
                                }
                                else {
                                    htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                    htmlcode += "     <span class='highlight-blue-1 interest-rate'>Liên hệ</span><br>";
                                    htmlcode += "  </td>";
                                }
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Tham gia' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Tham gia</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                    }
                    else {
                        htmlcode = "<tr><td colspan='4' style='text-align:center;'><tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>Không có dữ liệu phù hợp</p></td></tr></td></tr>";
                    }
                    $("#pro-list").html(htmlcode);
                }

            });
            $.mobile.hidePageLoadingMsg();
        }
        else {
            var amount = $("#amount-saving").val().replace(",", "").replace(",", "").replace(",", "");
            var ba = parseFloat(amount);
            $.ajax({
                type: "post",
                url: AppUrl + "/ConsumerLoan/getConsumerLoanByProvider",
                data: { planid: val_cate, balance: ba, years: val_month, CompanyID: comid },
                dataType: "json",
                success: function (rvdata) {
                    var htmlcode = "";
                    if (rvdata.length > 0) {
                        if (val_cate == 1) {
                            $(rvdata).each(function (index, item) {
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src=''></a>";
                                htmlcode += "   </strong></td>";
                                htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                htmlcode += "     <span class='highlight-blue interest-rate'>Contact</span><br>";
                                htmlcode += "  </td>";
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                        else {
                            var payment = 0;
                            $(rvdata).each(function (index, item) {
                                var total = 0;
                                for (i = 1; i <= val_month * 12; i++) {
                                    total += Math.pow((1 + (item.InterestVND / 100 / 12)), -i);
                                }
                                htmlcode += "    <tr class='odd views-row-first'>";
                                htmlcode += "   <td class='views-field views-field-name muted'>";
                                htmlcode += "     <strong><a title='" + item.ConsumerLoanName + "' class='name-product-list ui-link' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + convertounsign(item.ConsumerLoanName).toLowerCase() + "/" + item.ConsumerLoanID + "'>" + item.ConsumerLoanName + "</a>";
                                htmlcode += "        <br>";
                                htmlcode += " <a title='" + item.CompanyName + "' href='" + AppUrl + "/consumer-loan/" + convertounsign(item.CompanyName).toLowerCase() + "/" + item.CompanyID + "' class='ui-link'>";
                                htmlcode += "           <img class='img-logo-bank' src='" + urlvnbanknet + "/" + item.CompanyImg + "'></a>";
                                htmlcode += "   </strong></td>";
                                if (item.InterestVND != 0) {
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + item.InterestVND.toString().replace(",", ".") + " %</p>";
                                    htmlcode += " </td>";
                                    htmlcode += " <td style='vertical-align:middle;'>";
                                    htmlcode += "<p class='highlight-blue text-p'>" + number_format(ba / total, 0, ".", ",") + "</p>";

                                    htmlcode += " </td>";
                                }
                                else {
                                    htmlcode += "   <td class='cl-mid highlight-blue interest-rate-data value' colspan='2'>";
                                    htmlcode += "     <span class='highlight-blue-1 interest-rate'>Liên hệ</span><br>";
                                    htmlcode += "  </td>";
                                }
                                htmlcode += "  <td class='cl-mid text-center'><a href='" + AppUrl + "/consumer-loan/apply/" + item.ConsumerLoanID + "' data-role='button' data-icon='arrow-r' data-iconpos='notext' data-theme='c' data-inline='true' data-corners='true' data-shadow='true' data-iconshadow='true' data-wrapperels='span' title='Apply' class='ui-btn ui-btn-up-c ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-notext'><span class='ui-btn-inner'><span class='ui-btn-text'>Apply</span><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></span></a></td>";
                                htmlcode += "  </tr>";
                            });
                        }
                    }
                    else {
                        htmlcode = "<tr><td colspan='4' style='text-align:center;'><tr><td colspan='6' style='margin-top: 10px;font-weight: bold;text-align: center;margin-bottom: 10px;'>No result</p></td></tr></td></tr>";
                    }
                    $("#pro-list").html(htmlcode);
                }

            });
            $.mobile.hidePageLoadingMsg();
        }
    });
    $(".amount").keydown(function (event) {
        // Allow: backspace, delete, tab, escape, and enter
        if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
            // Allow: Ctrl+A
            (event.keyCode == 65 && event.ctrlKey === true) ||
            // Allow: home, end, left, right
            (event.keyCode >= 35 && event.keyCode <= 39)) {
            // let it happen, don't do anything
            return;
        }
        else {
            // Ensure that it is a number and stop the keypress
            if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                event.preventDefault();
            }
        }
    });
    $(".years").keydown(function (event) {
        // Allow: backspace, delete, tab, escape, and enter
        if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
            // Allow: Ctrl+A
            (event.keyCode == 65 && event.ctrlKey === true) ||
            // Allow: home, end, left, right
            (event.keyCode >= 35 && event.keyCode <= 39)) {
            // let it happen, don't do anything
            return;
        }
        else {
            // Ensure that it is a number and stop the keypress
            if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                event.preventDefault();
            }
        }
    });
});